package com.ruoyi.account.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.AccountChannelInfoMapper;
import com.ruoyi.db.domain.AccountChannelInfo;
import com.ruoyi.account.service.IAccountChannelInfoService;

/**
 * 渠道账户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-28
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class AccountChannelInfoServiceImpl implements IAccountChannelInfoService 
{
    @Autowired
    private AccountChannelInfoMapper accountChannelInfoMapper;

    /**
     * 查询渠道账户信息
     * 
     * @param id 渠道账户信息主键
     * @return 渠道账户信息
     */
    @Override
    public AccountChannelInfo selectAccountChannelInfoById(Long id)
    {
        return accountChannelInfoMapper.selectAccountChannelInfoById(id);
    }

    /**
     * 查询渠道账户信息列表
     * 
     * @param accountChannelInfo 渠道账户信息
     * @return 渠道账户信息
     */
    @Override
    public List<AccountChannelInfo> selectAccountChannelInfoList(AccountChannelInfo accountChannelInfo)
    {
        return accountChannelInfoMapper.selectAccountChannelInfoList(accountChannelInfo);
    }

    /**
     * 查询渠道账户信息列表
     *
     * @param accountChannelInfo 渠道账户信息
     * @return 渠道账户信息
     */
    @Override
    public List<Map<String, Object>> selectAccountChannelInfoMapList(AccountChannelInfo accountChannelInfo)
    {
        return accountChannelInfoMapper.selectAccountChannelInfoMapList(accountChannelInfo);
    }

    /**
     * 新增渠道账户信息
     * 
     * @param accountChannelInfo 渠道账户信息
     * @return 结果
     */
    @Override
    public int insertAccountChannelInfo(AccountChannelInfo accountChannelInfo)
    {
        accountChannelInfo.setCreateTime(DateUtils.getNowDate());
        return accountChannelInfoMapper.insertAccountChannelInfo(accountChannelInfo);
    }

    /**
     * 修改渠道账户信息
     * 
     * @param accountChannelInfo 渠道账户信息
     * @return 结果
     */
    @Override
    public int updateAccountChannelInfo(AccountChannelInfo accountChannelInfo)
    {
        accountChannelInfo.setUpdateTime(DateUtils.getNowDate());
        return accountChannelInfoMapper.updateAccountChannelInfo(accountChannelInfo);
    }

    /**
     * 批量删除渠道账户信息
     * 
     * @param ids 需要删除的渠道账户信息主键
     * @return 结果
     */
    @Override
    public int deleteAccountChannelInfoByIds(Long[] ids)
    {
        return accountChannelInfoMapper.deleteAccountChannelInfoByIds(ids);
    }

    /**
     * 删除渠道账户信息信息
     * 
     * @param id 渠道账户信息主键
     * @return 结果
     */
    @Override
    public int deleteAccountChannelInfoById(Long id)
    {
        return accountChannelInfoMapper.deleteAccountChannelInfoById(id);
    }
}
